home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / ConditionalMacros.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  4.7 KB  |  128 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ConditionalMacros.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  18. __CONDITIONALMACROS__ SET 1
  19.  
  20. ;
  21. ;    This file sets up the following compiler independent conditionals:
  22. ;    
  23. ;    GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  24. ;    GENERATING68K            - Compiler is generating 68k family instructions
  25. ;    GENERATING68881            - Compiler is generating mc68881 floating point instructions
  26. ;    GENERATINGCFM            - Code being generated assumes CFM calling conventions
  27. ;    CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  28. ;    
  29. ;    SystemSevenFiveOrLater    - Compiled code will only be run on a System 7.5 or later Macintosh
  30. ;    SystemSevenOrLater        - Compiled code will only be run on a System 7.0 or later Macintosh
  31. ;    SystemSixOrLater        - Compiled code will only be run on a System 6.0 or later Macintosh
  32. ;                              A developer should set the appropriate flag on the compiler command-
  33. ;                              line or in a file processed before this file.  This will allow the
  34. ;                              certain optimizations to be made which can result in smaller, faster
  35. ;                              applications.
  36. ;    
  37. ;    CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  38. ;                              are: all lowercase, use C strings instead of pascal strings, use 
  39. ;                              Point* instead of Point).
  40. ;
  41. ;    OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  42. ;                              (e.g. DisposPtr instead of DisposePtr). The names of system routine
  43. ;                              are now more sensitive to change because CFM binds by name.  In the 
  44. ;                              past, system routine names were compiled out to just an A-Trap.  
  45. ;                              Macros have been added that each map an old name to its new name.  
  46. ;                              This allows old routine names to be used in existing source files,
  47. ;                              but the macros only work if OLDROUTINENAMES is true.  This support
  48. ;                              will be removed in the near future.  Thus, all source code should 
  49. ;                              be changed to use the new names! You can set OLDROUTINENAMES to false
  50. ;                              to see if your code has any old names left in it.
  51. ;    
  52. ;    OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  53. ;                              has been moved from Strings to TextUtils.  It is conditionalized in
  54. ;                              Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  55. ;                              This allows developers to upgrade to newer interface files without suddenly
  56. ;                              all their code not compiling becuase of "incorrect" includes.  But, it
  57. ;                              allows the slow migration of system calls to more understandable file
  58. ;                              locations.  OLDROUTINELOCATIONS currently defaults to true, but eventually
  59. ;                              will default to false.
  60. ;    
  61. ;    
  62. ;    There are some invariants among the conditionals:
  63. ;    
  64. ;    GENERATINGPOWERPC != GENERATING68K
  65. ;    GENERATING68881 => GENERATING68K
  66. ;    GENERATINGPOWERPC => GENERATINGCFM
  67. ;    GENERATINGPOWERPC => CFMSYSTEMCALLS
  68. ;    CFMSYSTEMCALLS => GENERATINGCFM
  69. ;    GENERATINGPOWERPC => SystemSevenOrLater
  70. ;    SystemSevenFiveOrLater => SystemSevenOrLater
  71. ;    SystemSevenOrLater => SystemSixOrLater
  72. ;    
  73. ;    
  74. ;
  75.     IF &TYPE('PowerAsm') <> 'UNDEFINED' THEN
  76.     GENERATINGPOWERPC: SET 1
  77.     GENERATING68K: SET 0
  78.     ELSE
  79.     GENERATINGPOWERPC: SET 0
  80.     GENERATING68K: SET 1
  81.     ENDIF
  82.     IF &TYPE('GENERATING68881') = 'UNDEFINED' THEN
  83.     GENERATING68881: SET 0
  84.     ENDIF
  85.     IF GENERATINGPOWERPC  THEN
  86.     CFMSYSTEMCALLS: SET 1
  87.     GENERATINGCFM: SET 1
  88.     ENDIF
  89.     IF &TYPE('GENERATINGCFM') = 'UNDEFINED' THEN
  90.     IF &TYPE('__CFM68K__') = 'UNDEFINED' THEN
  91.     GENERATINGCFM: SET 0
  92.     CFMSYSTEMCALLS: SET 0
  93.     ELSE
  94.     GENERATINGCFM: SET 1
  95.     CFMSYSTEMCALLS: SET 1
  96.     ENDIF
  97.     ENDIF
  98.     IF &TYPE('CFMSYSTEMCALLS') = 'UNDEFINED' THEN
  99.     CFMSYSTEMCALLS: SET 0
  100.     ENDIF
  101.     IF &TYPE('SystemSevenFiveOrLater') = 'UNDEFINED' THEN
  102.     SystemSevenFiveOrLater: SET 0
  103.     ENDIF
  104.     IF &TYPE('OLDROUTINENAMES') = 'UNDEFINED' THEN
  105.     OLDROUTINENAMES: SET 1
  106.     ENDIF
  107.     IF &TYPE('OLDROUTINELOCATIONS') = 'UNDEFINED' THEN
  108.     OLDROUTINELOCATIONS: SET 1
  109.     ENDIF
  110.     IF &TYPE('SystemSevenOrLater') = 'UNDEFINED' THEN
  111.     IF GENERATINGCFM  ++ SystemSevenFiveOrLater  THEN
  112.     SystemSevenOrLater: SET 1
  113.     ELSE
  114.     SystemSevenOrLater: SET 0
  115.     ENDIF
  116.     ENDIF
  117.     IF &TYPE('SystemSixOrLater') = 'UNDEFINED' THEN
  118.     SystemSixOrLater: SET SystemSevenOrLater
  119.     ENDIF
  120.     IF OLDROUTINENAMES  THEN
  121.     IF &TYPE('USES68KINLINES') = 'UNDEFINED' THEN
  122.     USES68KINLINES: SET GENERATING68K
  123.     ENDIF
  124.     USESCODEFRAGMENTS: SET GENERATINGCFM
  125.     USESROUTINEDESCRIPTORS: SET GENERATINGCFM
  126.     ENDIF
  127.     ENDIF ; __CONDITIONALMACROS__
  128.